<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理员管理-有点</title>
<link rel="stylesheet" type="text/css" href="/ci/public/admin/css/css.css" />
<script type="text/javascript" src="/ci/public/admin/js/jquery.min.js"></script>
<!-- <script type="text/javascript" src="/ci/public/admin/js/page.js" ></script> -->
</head>

<body>
	<div id="pageAll">
		<div class="pageTop">
			<div class="page">
				<img src="/ci/public/admin/img/coin02.png" /><span><a href="#">首页</a>&nbsp;-&nbsp;-</span>&nbsp;管理员管理
			</div>
		</div>

		<div class="page">
			<!-- user页面样式 -->
			<div class="connoisseur">
				<div class="conform">
					<form>
						<div class="cfD">
							<input class="addUser" type="text" placeholder="输入用户名/ID/手机号/城市" />
							<button class="button">搜索</button>
							<a class="addA addA1" href="<?php echo site_url()?>/admin/manage/roleadd">添加角色</a>
						</div>
					</form>
				</div>
				

				<!-- user 表格 显示 -->
				<div class="conShow">
					<table border="1" cellspacing="0" cellpadding="0">
						<tr>
							<td width="66px" class="tdColor tdC">序号</td>
							<td width="400px" class="tdColor">角色名称</td>
							<td width="630px" class="tdColor">角色描述</td>
							
							<td width="66px" class="tdColor tdC">是否开启</td>
							<td width="130px" class="tdColor">操作</td>
						</tr>
						<?php foreach ($data as $k => $v): ?>

						<tr height="40px" class="role_<?php echo $v['role_id'] ?>">
							<td><?php echo $k+1 ?></td>
							<td><?php echo $v['role_name'] ?></td>
							<td><?php echo $v['role_desc'] ?></td>
							<td>
							<?php if ($v['is_status']==1): ?>
								开启
							<?php endif ?>
							<?php if ($v['is_status']==0): ?>
								未开启
							<?php endif ?>
							
							</td>
							<td><a href="<?php echo site_url('admin/manage/roleup/'.$v['role_id']) ?>">修改</a> 
								<a href="<?php echo site_url('admin/manage/role_access/'.$v['role_id']) ?>">配置权限</a> 
								<a href="javascript:void(0)" onclick="fun(<?php echo $v['role_id'] ?>)" >删除</a>
							</td>
						</tr>
						<?php endforeach ?>
					</table>
					<div class="paging">此处是分页</div>
				</div>
				<!-- user 表格 显示 end-->
			</div>
			<!-- user页面样式end -->
		</div>

	</div>


	<!-- 删除弹出框 -->
	<div class="banDel">
		<div class="delete">
			<div class="close">
				<a><img src="/ci/public/admin/img/shanchu.png" /></a>
			</div>
			<p class="delP1">你确定要删除此条记录吗？</p>
			<p class="delP2">
				<a href="javascript:void(0)" class="ok yes">确定</a><a class="ok no">取消</a>
			</p>
		</div>
	</div>
	<!-- 删除弹出框  end-->
</body>

<script type="text/javascript">
// 无刷新删除
function fun(id){
	if (confirm('你确定要删除吗')) {
	  $.post(
	  	"<?php echo site_url('admin/manage/roledel') ?>", 
	  	{role_id: id}, 
	  	function(msg) {
	  		if (msg==1) {
	  			$(".role_"+id).remove();
	  		}else{
	  			alert('删除失败');
	  		}
	  });
  };

};
// 广告弹出框 end
</script>
</html>